<html lang="en">
<head>
    <title>区域管理</title>
    <#include "../common/header.ftl">
    <link rel="stylesheet" type="text/css" href="/js/plugins/bootstrap-select/bootstrap-select.css"/>
    <script src="/js/plugins/bootstrap-select/bootstrap-select.js"></script>

    <script type="text/javascript">
        $(function () {

            // 查看评论内容
            $(".commentShowBtn").click(function () {
                console.log(123);
                $("#refplace").html('');
                var id = $(this).data("id");
                $.get("/strategyComment/getStrategyCommentById", {sid:id}, function (data) {
                    console.log(data.content);
                    var html = data.content;
                    $("#refplace").html(html);
                    $("#commentModal").modal("show");
                })
            })

        })
    </script>
</head>
<body>
<!--左侧菜单回显变量设置-->
<#assign currentMenu="strategyComment">

<div class="container-fluid " style="margin-top: 20px">
    <#include "../common/top.ftl">
    <div class="row">
        <div class="col-sm-2">
            <#include "../common/menu.ftl">
        </div>
        <div class="col-sm-10">
            <div class="row">
                <div class="col-sm-12">
                    <h1 class="page-head-line">攻略评论管理</h1>
                </div>
            </div>
            <!--高级查询--->
            <form class="form-inline" id="searchForm" action="/strategyComment/list" method="post">
                <input type="hidden" name="currentPage" id="currentPage" value="1">
            </form>
            <table class="table table-striped table-hover" >
                <thead>
                    <tr>
                        <th>序号</th>
                        <th>攻略标题</th>
                        <th>用户名</th>
                        <th>评论内容</th>
                        <th>评论时间</th>
                        <th>操作</th>
                    </tr>
                </thead>
               <#list page.content as entity>
                   <tr>
                       <td>${entity_index+1}</td>
                       <td>${entity.strategyTitle!}</td>
                       <td>${entity.nickname!}</td>
                       <td>${entity.content!}</td>
                       <td>${entity.createTime?string("yyyy-MM-dd")}</td>
                       <td>

                           <a class="btn btn-info btn-xs commentShowBtn" href="JavaScript:;" data-id='${entity.id}'>
                               <span class="glyphicon glyphicon-pencil"></span> 查看
                           </a>
                           <a href="javascript:;" class="btn btn-danger btn-xs deleteBtn"
                              data-url="/strategyComment/delete?id=${entity.id}">
                               <span class="glyphicon glyphicon-trash"></span> 删除
                           </a>
                       </td>
                   </tr>
               </#list>
            </table>
            <#--分页-->
            <#include "../common/page.ftl"/>
        </div>
    </div>
</div>


<#--评论内容查看-->
<div class="modal fade" id="commentModal">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span> </button>
                <h4 class="modal-title">评论内容</h4>
            </div>
            <div class="modal-body">
                    <div class="form-group">
                        <div class="col-sm-12" id="refplace" style="width: 100%">
                        </div>
                    </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal" >确定</button>
            </div>
        </div>
    </div>
</div>

</body>
</html>
